package com.array;

/***
 * @ClassName: ArrayTest
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 11:24 2022/1/25
 * @version : V1.0
 */
public class ArrayTest {


    public static void main(String[] args) {
        //method1();
        int []a = {1,2,3,4,5,6,7,8,9};
        int[] resver = reverse(a);
        for (int i : resver) {
            System.out.println(i);
        }

    }
    static void method1() {
        int[] intArray;
        intArray = new int[10];
        for (int i = 0; i < intArray.length; i++) {
            System.out.println(intArray[i]);
        }

        int [] a = {1,2,3,4,5,6,7,8,9};
        int max =a[0];
        for (int i = 0; i < a.length; i++) {
            max = max>a[i]?max:a[i];
        }
        System.out.println("max"+max);
    }

    //反转数组
    static int[] reverse(int[] nums){
        int temp = nums.length;
        int[] ints = new int[temp];
        for (int i = 0; i < nums.length; i++) {
            ints[temp-1-i] = nums[i];
        }
        return ints;
    }

}
